package com.xmg.day10;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author: mazhongqing
 * @Date: 2020/11/5 12:15
 */
public class SpringLoadDemo {
    public static void main(String[] args) {
        //ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("cycle.xml");
//
//        Book book = (Book) applicationContext.getBean("book");
//
//        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
//        for (int i = 0; i < beanDefinitionNames.length; i++) {
//            System.out.println(beanDefinitionNames[i]);
//            System.out.println(applicationContext.getBean(beanDefinitionNames[i]));
//        }
//
//        System.out.println(book );
    }
}
